<?php
/**
 * Model providing vendor-specific implementation of SQLDatabase. Needs to be extended by a class implementing an individual database your application uses.
 */
abstract class MySQLDatabase extends SQLDatabase {
	/**
	 * (non-PHPdoc)
	 * @see SQLDatabase::create()
	 */
	public function create() {
		$objQuery = new MySQLDatabaseQuery($this->strDatabaseName);
		$this->server->executeStatement($objQuery->create());
	}	
	
	/**
	 * (non-PHPdoc)
	 * @see SQLDatabase::getTables()
	 */
	public function getTables() {
		$objQuery = new MySQLDatabaseQuery($this->strDatabaseName);
		return SQLResults::toColumn($this->server->executeStatement($objQuery->getTables()));
	}

	/**
	 * (non-PHPdoc)
	 * @see SQLDatabase::rename()
	 */
	public function rename($strNewDatabaseName) {
		$objQuery = new MySQLDatabaseQuery($this->strDatabaseName);
		$this->server->executeStatement($objQuery->rename($strNewDatabaseName));
	}
	
	/**
	 * (non-PHPdoc)
	 * @see SQLDatabase::drop()
	 */
	public function drop() {
		$objQuery = new MySQLDatabaseQuery($this->strDatabaseName);
		$this->server->executeStatement($objQuery->drop());
	}
}